package com.jwds.digital.bios.business.schedule.task;

import com.jwds.digital.bios.business.schedule.service.IScheduleTaskService;
import com.jwds.tdc.framework.application.lib.BaseResponse;
import com.jwds.tdc.framework.schedule.annotation.ScheduleRegister;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 调度 定时任务
 *
 * @Author hesong
 */
@Slf4j
@Component
public class ScheduleTask {

    @Autowired
    private IScheduleTaskService taskService;


//    /**
//     * 测试定时任务（示例）
//     *
//     * @ScheduleRegister 自动注册注解，cron表达式
//     */
//    @XxlJob("flow-task-demo")
//    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "何松", jobDesc = "定时任务测试")
//    public void biosScheduleDemo() throws InterruptedException {
//        taskService.biosScheduleDemo();
//    }

//    /**
//     * 调度定时任务
//     *
//     * @ScheduleRegister 自动注册注解，cron表达式
//     */
//    @XxlJob("dispatch-monitor")
//    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "何松", jobDesc = "调度监控定时任务")
//    public void dispatchMonitor() throws InterruptedException {
//        taskService.dispatchMonitor();
//    }
//
//    /*
//    * 受料检测是否停止
//    *
//    *
//    * */
//    @XxlJob("flow-task-deno")
//    @ScheduleRegister(cron = "0/5 * * * *?", author = "", jobDesc = "受料检测")
//    public ReturnT<String> checkQuantityAndTime() {
//        return taskService.checkQuantityAndTimeFromInterface();
//    }
//
//    /*
//    * 返料检测是否停止
//    *
//    *
//    * */
//    @XxlJob("return-inspection")
//    @ScheduleRegister(cron = "0/5 * * * *?", author = "", jobDesc = "返料检测")
//    public ReturnT<String> ReturnInspection() {
//        return taskService.ReturnInspection();
//    }
//
//    /*
//    * 内部转运检测是否停止
//    *
//    *
//    * */
//    @XxlJob("internal-transport-inspection")
//    @ScheduleRegister(cron = "0/5 * * * *?", author = "", jobDesc = "内部转运检测")
//    public ReturnT<String> internalTransportInspection() {
//        return taskService.DispatchInternalTransport();
//    }
//
//
//    /*
//    * 供料调度检测是否停止
//    *
//    *
//    * */
//    @XxlJob("dispatch-feed")
//    @ScheduleRegister(cron = "0/5 * * * *?", author = "", jobDesc = "供料调度检测")
//    public ReturnT<String> dispatchFeed() {
//        return taskService.dispatchFeed();
//    }

    /**
     * 预配料仓
     */
    @XxlJob("dispatch-preIngredientWarehouse")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "王钰博", jobDesc = "预配料仓")
    public void preIngredientWarehouse() {
        taskService.preIngredientWarehouse();
    }

    /**
     * 块矿缓冲仓加仓
     * */
    @XxlJob("dispatch-blockMine")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "王钰博", jobDesc = "块矿缓冲仓加仓")
    public void dispatchBlockMine() {
        taskService.dispatchBlockMine();
    }


    /**
     * 烧结燃料仓
     */
    @XxlJob("dispatch-sinterBunker")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "李志明", jobDesc = "烧结燃料仓")
    public void sinterBunker() {
        taskService.sinterBunker();
    }

    /**
     * 球团成品仓
     */
    @XxlJob("dispatch-finishedPellet")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "李志明", jobDesc = "球团成品仓")
    public void finishedPellet() {
        taskService.finishedPellet();
    }

    /**
     * 烧结成品仓
     */
    @XxlJob("dispatch-sinteredProduct")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "李志明", jobDesc = "烧结成品仓")
    public void sinteredProduct() {
        taskService.sinteredProduct();
    }

    /**
     * 球团供料加仓
     */
    @XxlJob("dispatch-ballGroup")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "申明洋", jobDesc = "球团供料仓")
    public void dispatchBallGroup() {
        taskService.dispatchBallGroup();
    }


    /**
     * 2#烧结供料加仓
     */
    @XxlJob("dispatch-2SinterFeed")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "申明洋", jobDesc = "2#烧结供料仓")
    public void dispatch2SinterFeed() {
        taskService.dispatch2SinterFeed();
    }

    /**
     * 3#烧结供料加仓
     */
    @XxlJob("dispatch-3SinterFeed")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "申明洋", jobDesc = "3#烧结供料仓")
    public void dispatch3SinterFeed() {
        taskService.dispatch3SinterFeed();
    }


    /**
     * 4#烧结供料加仓
     */
    @XxlJob("dispatch-4SinterFeed")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "申明洋", jobDesc = "4#烧结供料仓")
    public void dispatch4SinterFeed() {
        taskService.dispatch4SinterFeed();
    }

    /**
     * 白云石仓加仓
     */
    @XxlJob("dispatch-BYSC")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "申明洋", jobDesc = "白云石仓")
    public void dispatchBYS() {
        taskService.dispatchBYS();
    }


    /**
     * 石灰石仓加仓
     */
    @XxlJob("dispatch-SHSC")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "申明洋", jobDesc = "石灰石仓")
    public void dispatchSHS() {
        taskService.dispatchSHS();
    }

    /**
     * 高炉返料
     * */
    @XxlJob("dispatch-BlastFurnaceReturnMaterial")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "王钰博", jobDesc = "高炉返料")
    public void BlastFurnaceReturnMaterial() {
        taskService.BlastFurnaceReturnMaterial();
    }

    /**
     * 矿粉仓返料
     * */
    @XxlJob("dispatch-MineralPowderWarehouse")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "王钰博", jobDesc = "矿粉仓返料")
    public void MineralPowderWarehouse() {
        taskService.MineralPowderWarehouse();
    }


    /**
     * 焦粉仓返料
     * */
    @XxlJob("dispatch-CokingPowderWarehouse")
    @ScheduleRegister(cron = "0/5 * * * * ? ", author = "王钰博", jobDesc = "焦粉仓返料")
    public void CokingPowderWarehouse() {
        taskService.CokingPowderWarehouse();
    }

}
